package com.neuedu.service;

import java.util.List;

import com.neuedu.Dao.CateDao;
import com.neuedu.Dao.CateDaoImpl;
import com.neuedu.projos.Cate;
import com.neuedu.projos.ProductPage;

public class CateServImpl implements CateServ {
	CateDao cateDao = new CateDaoImpl();
	@Override
	public ProductPage<Cate> getsCate(int pageNum,int pageSize) {
		int allRecords = cateDao.getAllCounts();
		ProductPage pageBean =new ProductPage(pageNum,pageSize,allRecords);
		List <Cate> getCateByLimit=cateDao.getCateByLimit(pageBean.getStartIndex(), pageSize);
		pageBean.setPros(getCateByLimit);
		return pageBean;
	}
	@Override
	public List<Cate> getAllOneCate() {
		return cateDao.getAllOneCate();
	}
	@Override
	public void addCate(Cate cate) {
		cateDao.addCate(cate);
	}
}
